package com.ruoyi.web.controller.tzzl;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.tzzl.domain.WzPhotoAlbum;
import com.ruoyi.tzzl.domain.WzProgramUser;
import com.ruoyi.tzzl.service.IWzPhotoAlbumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.annotation.Id;
import org.springframework.web.bind.annotation.*;

/**
 * 微信用户相册Controller
 * @author by caoyong
 * @date 2022/11/8
 **/
@RestController
@RequestMapping("/tzzl/album")
public class WzPhotoAlbumController extends BaseController {

    @Autowired
    private IWzPhotoAlbumService wzPhotoAlbumService;


    /**查看微信用户相册*/
    @GetMapping("/photoAlbum")
    public AjaxResult photoAlbum(Long id){
        return AjaxResult.success(wzPhotoAlbumService.getByWid(id));
    }

    /**
     * 删除用户相册
     * */
    @PostMapping("/deleteId")
    public AjaxResult deleteId(@RequestBody WzProgramUser wzProgramUser){
        return AjaxResult.success(wzPhotoAlbumService.removeById(wzProgramUser.getId()));
    }

}
